Developing Enterprise iOS Applications by James Turner
Author:James Turner
Language: eng
Format: mobi, pdf
Tags: COMPUTERS / Programming / Apple Programming
ISBN: 9781449314415
Publisher: O'Reilly Media
Published: 2011-08-25T22:00:00+00:00
Example 4-6. The getSingleStringValue method
-(id) getSingleStringValue:(DDXMLElement *) element
xpath:(NSString *) xpath {
NSError *error = nil;
NSArray *vals = [element nodesForXPath:xpath error:&error];
if (error != nil) {
return nil;
}
if ([vals count] != 1) {
return nil;
}
DDXMLElement *val = [vals objectAtIndex:0];
return [val stringValue];
}
Basically, the method takes the root element for the extraction, and a relative or absolute XPath expressing as a string. It gets the array of matching elements, makes sure there wasn’t an error (such as an invalid XPath string), and if it gets back exactly one element in the array, returns it.
Once I have the dictionary, I iterate over the temperature data, grabbing attributes and element values as appropriate, then use the diction to find the time associated with the reading. Finally, I dump the data out to the log, resulting in this kind of output:
Type: maximum, Units: Fahrenheit
2011-11-16T07:00:00-05:00, Daily Maximum Temperature = 58
Download
Developing Enterprise iOS Applications by James Turner.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
The Mikado Method by Ola Ellnestam Daniel Brolund(21477)
Hello! Python by Anthony Briggs(20727)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(19164)
Dependency Injection in .NET by Mark Seemann(18795)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(18398)
Kotlin in Action by Dmitry Jemerov(18158)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(18048)
Adobe Camera Raw For Digital Photographers Only by Rob Sheppard(16943)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(16888)
Grails in Action by Glen Smith Peter Ledbrook(16023)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(13739)
Secrets of the JavaScript Ninja by John Resig & Bear Bibeault(11750)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(10610)
A Developer's Guide to Building Resilient Cloud Applications with Azure by Hamida Rebai Trabelsi(10585)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(9683)
Hit Refresh by Satya Nadella(9097)
The Kubernetes Operator Framework Book by Michael Dame(8532)
Exploring Deepfakes by Bryan Lyon and Matt Tora(8355)
Robo-Advisor with Python by Aki Ranin(8299)